package com.ext.aic.utils;

import androidx.fragment.app.FragmentManager;

import com.ext.aic.fragment.BaseFragment;

public class FragmentUtils {

    private static volatile FragmentUtils instance;

    public static FragmentUtils getInstance() {
        if (instance == null) {
            synchronized (FragmentUtils.class) {
                if (instance == null) {
                    instance = new FragmentUtils();
                }
            }
        }
        return instance;
    }

    public <F extends BaseFragment> void bind(FragmentManager fragmentManager, int frameLayoutId, F fragment) {
        fragmentManager.beginTransaction()
                .add(frameLayoutId, fragment)
                .commit();
    }
}
